<%@page import="com.nisco.dms.entity.Menu"%>
<%@page import="java.util.List"%>
<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" trimDirectiveWhitespaces="true"%>
<%@ include file="/WEB-INF/views/include.inc.jsp"%>
<head>
<style type="text/css">
/* #defindetree li ul{background-color: #eef4f5} */
</style>
<script type="text/javascript">
$(function(){
	//document.write($("#selectModule").html());
 	$("#selectModule").find("a").click(function()
			{
 				$("#selectedModule").val($(this).find("span").text());
 				$("#selectedModuleId").val(this.id);
 				$("#selectedModuletest").val(this.id);
 				//$("#selectModuleForm").submit();selectedModuletest
			});
	});
</script>
</head>
<h2 class="contentTitle">选择组件</h2>
<form method="post" action="${ctx}/role/list" class="required-validate pageForm" onsubmit="return validateCallback(this, navTabAjaxDone);">
	<div class="pageFormContent" layoutH="97">
	<div class="divider"></div>
	<ul class="tree [treeFolder  [collapse]]" oncheck="kkk" id="defindetree">
	    <li><a href="#" >${module.strName } 	<span class="11" style="float: right;">
			</span></a>

		<%
				
				Menu module = (Menu)request.getAttribute("module");
				int ind = 0;
				out.println("<ul id='selectModule'>");
				for (int m1ind = 0; m1ind < module.getChildren().size(); m1ind++) {
					Menu m1 = module.getChildren().get(m1ind);
					out.println("<li>");
					out.println("<a href=\"permission/list?moduleId="+m1.getId()+"\" class=\"permissionList\" id='"+m1.getId()+"' target='ajax' rel='selectModuleDiv'>");
					out.println("<span class=\"module_name\">" + m1.getStrName() + "</span>");
					out.println("<span class=\"inputValue\">");
					out.println("</span>");
					out.println("</a>");
					if (!m1.getChildren().isEmpty()) {
						out.println("<ul>");
						for (int m2ind = 0; m2ind < m1.getChildren().size(); m2ind++) {
							ind++;
							Menu m2 = m1.getChildren().get(m2ind);
							out.println("<li>");
							out.println("		<a href=\"permission/list?moduleId="+m2.getId()+"\" class=\"permissionList\" id='"+m2.getId()+"' target='ajax' rel='selectModuleDiv'>");
							out.println("<span class=\"module_name\">" + m2.getStrName() + "</span>");
							out.println("<span class=\"inputValue\">");
							out.println("</span>");
							out.println("		</a>");
							if (!m2.getChildren().isEmpty()) {
								out.println("<ul>");
								for (int m3ind = 0; m3ind < m2.getChildren().size(); m3ind++) {
									ind++;
									Menu m3 = m2.getChildren().get(m3ind);
									out.println("			<li>");
									out.println("		<a href=\"permission/list?moduleId="+m3.getProgram().getId()+"\" class=\"permissionList\" id='"+m3.getProgram().getId()+"' target='ajax' rel='selectModuleDiv'>");
									out.println("<span class=\"module_name\">" + m3.getStrName() + "</span>");
									out.println("<span class=\"inputValue\">");
									out.println("</span>");
									out.println("</a>");
									out.println("</li>");
								}
								out.println("		</ul>");
							} 
							out.println("		<li>");
						}
						out.println("		</ul>");
					}
					out.println("		</li>");
					ind++;	
					}
					
				out.println("		</ul>");	
					
					%>

                  </li>

	</ul>
	</div>
			
	<div class="formBar">
		<ul>
		<%-- 	<li><a href="${ctx}/permission/list" target="ajax" rel="selectModuleDiv" close="true">确定</a></li> --%>
			<li><div class="button"><div class="buttonContent"><button  type="button" class="close">确定</button></div></div></li>
		</ul>
	</div>
</form>